#	Copyright (C) 2009 Salil Bhagurkar

SOURCES=arch/1.o arch/excep.o arch/gdt.o arch/idt.o arch/int.o arch/task.o                          arch/8259.o arch/debug.o arch/exc.o arch/info.o arch/init.o arch/irq.o arch/printk.o arch/modules.o      stdlib/cmdline.o stdlib/ctype.o stdlib/printf.o stdlib/string.o      kernel/fs/fs.o kernel/fs/fsparse.o kernel/fs/fsres.o kernel/fs/fsrun.o kernel/fs/fsiter.o kernel/fs/fsdbg.o           kernel/buffer.o kernel/dprint.o kernel/stuff.o kernel/main.o kernel/malloc.o kernel/sched.o kernel/driver.o kernel/module.o kernel/kif.o      devices/init.o devices/lib/init.o devices/lib/xmlparse.o devices/class/init.o devices/serial.o devices/printk.o devices/keyb.o devices/biosdisk.o                      vmdrv/init.o vmdrv/string.o vmdrv/console.o vmdrv/link.o

CC=gcc
CFLAGS=-c -nostdlib -nostdinc -fno-builtin -I include -fleading-underscore -O0 -Werror -g
LDFLAGS=-Tlscript -M > lmap
ASFLAGS=-felf

all: link

link: $(SOURCES)
	ld $(LDFLAGS) -o kernel.bin $(SOURCES)

.s.o:
	nasm $(ASFLAGS) -o $@ $<
clean:
	find . -name '*.o' -print0 | xargs -0 rm
#	rm -rf kernel/*.o
#	rm -rf kernel/fs/*.o
#	rm -rf arch/*.o
#	rm -rf stdlib/*.o
#	rm -rf vmdrv/*.o
